/**
\file IO.h
*/
#pragma once
#include <lostlbase.h>
#include "System.h"
#include "LoDll.h"

namespace lo {

	/** User name */
	union UserNameFormat
	{
	public:
		UserNameFormat(int value) : m_value(value) {}
		enum { Unknown = 0, FullyQualifiedDN = 1, SamCompatible = 2, Display = 3, UniqueId = 6,
				Canonical = 7, UserPrincipal = 8, CanonicalEx = 9, ServicePrincipal = 10, DnsDomain = 12 };
	private:
		int	m_value;
	};

	/**
	This class is used to get various pieces of information from the system.
	*/
	class Advapi32 : public dll
	{
	public:
		Advapi32() : dll("advapi32") {}
		/** Gets the user name */
		string	getUserName( );
		bool	initializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision );
		LONG	regCloseKey( _In_ HKEY hKey );
		LONG	regOpenKeyEx( _Out_ PHKEY phkResult, _In_ HKEY hKey, _In_opt_ const char * lpSubKey = nullptr, _In_ REGSAM samDesired = KEY_ALL_ACCESS );
		bool	setSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted);
	private:
	};

}